<template>
	<view>
		<view class="background pb20">
			<u-navbar :background="{background:'#0000'}" :title="$params.name + '列表'" titleColor="#fff" :borderBottom="false"
				back-icon-color="#fff" />
			<view class="pl20 pr20 mt30 mb10">
				<u-search placeholder="请输入搜索内容" :show-action="false" bg-color="#fff" :search-icon-color="$zs"
					height="76" placeholder-color="#B7B5B5" v-model="keywords"></u-search>
			</view>
			<!-- 			<screenList v-model="listParams" @input="getList()" :level="data.hospital_level" :types="data.hospital_type" class="color-fff"
				:type="$params.type" pa /> -->
		</view>
		<!-- <goodsList v-if="$params.type=='fu'" :list="list" /> -->
		<hospitalList v-if="$params.type=='yy'" :list="list" />
		<masterList v-if="$params.type == 'pzs'" :list="list" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keywords: '',
				list: '',
				listParams: {
					hospital_type: '全部医院', //医院类型
					service_id: '', //项目id
					price: '', //syn=综合价格,asc=由低到高,desc=由高到低
					distance: '', //	字符串	非必填	-	-	综合距离:asc=由近到远,desc=由远到近
					sale: 'syn', //销量 syn=综合',,asc=由低到高,desc=由高到低
				},

				data: '',

				num: 0
			};
		},
		watch: {
			keywords(e) {
				if (this.num) {
					this.$u.debounce(this.getList, 500)
				}
			},
		},
		onLoad(e) {
			this.keywords = e.keywords
			uni.setNavigationBarTitle({
				title: (e.name || '') + '列表'
			})
			this.getList()
			setTimeout(() => {
				this.num = 1
			}, 500)
			// this.getData()
		},
		methods: {
			// getData() {
			// 	this.$request('/member/index/index').then(res => {
			// 		this.data = res.data
			// 	})
			// },
			getList(e) {
				let data = this.$params
				e == 'down' ? this.page++ : this.page = 1
				let params = {
					page: this.page,
					keyword: this.keywords, //	字符串	非必填	-	-	搜索关键词
					// ...this.listParams,
				}
				this.$request(data.api, params).then(res => {
					let list = res.data.data
					e == 'down' ? this.list.push(...list) : this.list = list
				})
			},
		},
	}
</script>

<style lang="scss">

</style>
